package com.link.base.base.policy.service;

import com.link.base.base.policy.dao.mybatis.mapper.PcyAttributeMapper;
import com.link.base.base.policy.model.PcyAttribute;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author unknown
 * @date unknown
 * @comments 政策客户属性服务
 */
@Service
public class PcyAttributeServiceImpl extends BasicServiceImpl<PcyAttribute> implements PcyAttributeService {

    @Resource
    private PcyAttributeMapper pcyAttributeMapper;

    @Override
    public BasicMapper<PcyAttribute> getBasicMapper() {
        return pcyAttributeMapper;
    }


    /**
     * @auther HuangLJ
     * @param pcyAttribute 政策Id pcyId
     * @return
     * @throws Exception
     * @Comments 通过政策Id 查询政策客户属性范围
     */
    @Override
    public List<PcyAttribute> queryAttrByPcyId(PcyAttribute pcyAttribute) throws Exception {
        List<PcyAttribute> pcyTypeAttributeList = pcyAttributeMapper.queryAttrByPcyId(pcyAttribute);
        if (pcyTypeAttributeList == null) {
            return null;
        }
        return pcyTypeAttributeList;
    }
}
